slackware_explor
(usa Slackware)
Enviado em 21/01/2009 - 15:28h
Hi folks,
First of all, hats of to Flavio for maintaining these fglrx packages
for Debian. I've been using them for over 4 months now and they've
been a real time-saver.
On to some background for my question. I run both Woody and Sarge
boxes. Up till now I've been doing all kernel compiles on a Woody
box. But my Sarge box has got a faster CPU under the hood these
days so just today I tried compiling everything on it instead.
The problem is seemingly related to the way include/linux/version.h
is removed on a "make clean" on newer 2.6.x kernels, such as 2.6.5
(what I'm compiling). The kernel Makefile's CLEAN_FILES variable
now includes such versioned files in the clean target:
CLEAN_DIRS += $(MODVERDIR) include/config include2
CLEAN_FILES += vmlinux System.map \
include/linux/autoconf.h include/linux/version.h \
include/asm include/linux/modversions.h \
kernel.spec .tmp*
Debian's make-kpkg apparently does a make clean in there after
building kernel_image, so subsequently built modules that go looking
for version.h get hosed.
The nvidia proprietary drivers puke on this new behavior. The
workaround for them is to define "do_clean := NO" in
/etc/kernel-pkg.conf. This seems to work.
So with that trivia established, what exactly is my problem?
Compiling stock kernel 2.6.5 (from kernel.org) with
fglrx-4.X.0-3.7.6 (or 4.X.0-3.7.0, tried that too) on a Woody box
seems to build everything without incident. Doing the same compile
with exactly the same commands (and the addition of 'setenv
MAKEFLAGS "CC=gcc-2.95"' before the build) on a Sarge box fails when
it gets to the fglrx modules.
The built commands are:
setenv MAKEFLAGS "CC=gcc-2.95"
cd /usr/src/linux-2.6.5
make oldconfig
make-kpkg clean
make-kpkg --append_to_version -pm --revision yoda.1 kernel_image kernel_headers modules_image
SARGE SCENARIO #1:
If I do NOT define "do_clean := NO" in /etc/kernel-pkg.conf on
Sarge, I only get these packages successfully built:
kernel-headers-2.6.5-pm_yoda.1_i386.deb
kernel-image-2.6.5-pm_yoda.1_i386.deb
And all three fglrx packages (for XF86 4.1.0, 4.2.0, and 4.3.0) fail
to build, starting with this error:
make[1]: Entering directory `/usr/src/modules/fglrx-4.1.0-3.7.6'
if [ -f /usr/src/modules/fglrx-4.1.0-3.7.6/debian/control.template ]; then \
cat /usr/src/modules/fglrx-4.1.0-3.7.6/debian/control.template > /usr/src/modules/fglrx-4.1.0-3.7.6/debian/control; \
fi
dh_testdir
touch configure-stamp
dh_testdir
./make.sh
ATI module generator V 2.0
==========================
initializing...
kernel includes at /usr/src/linux-2.6.5/include not found or incomplete
file: /usr/src/linux-2.6.5/include/linux/version.h
make[1]: *** [build] Error 1
make[1]: Leaving directory `/usr/src/modules/fglrx-4.1.0-3.7.6'
Module /usr/src/modules/fglrx-4.1.0-3.7.6 failed.
Hit return to Continue
make: *** [modules_image] Interrupt
So, it's looking for include/linux/version.h and not finding it.
SARGE SCENARIO #2:
If I DO define "do_clean := NO" in /etc/kernel-pkg.conf on Sarge, I
get these debian packages successfully built:
fglrx-4.1.0-kernel-2.6.5-pm_3.7.6-3+yoda.1_i386.deb
kernel-headers-2.6.5-pm_yoda.1_i386.deb
kernel-image-2.6.5-pm_yoda.1_i386.deb
And the other two fglrx packages (for XF86 4.2.0 and 4.3.) fail to
build and dump out with this error:
-----------------------------------------------------------
make[1]: Leaving directory `/usr/src/modules/fglrx-4.1.0-3.7.6'
Module /usr/src/modules/fglrx-4.1.0-3.7.6 processed fine
make[1]: Entering directory `/usr/src/modules/fglrx-4.2.0-3.7.6'
if [ -f /usr/src/modules/fglrx-4.2.0-3.7.6/debian/control.template ]; then \
cat /usr/src/modules/fglrx-4.2.0-3.7.6/debian/control.template > /usr/src/modules/fglrx-4.2.0-3.7.6/debian/control; \
fi
dh_testdir
touch configure-stamp
dh_testdir
./make.sh
ATI module generator V 2.0
==========================
initializing...
Error:
kernel includes at /usr/src/linux-2.6.5/include do not match current kernel.
they are versioned as "2.6.5"
instead of "2.6.5-pm".
you might need to adjust your symlinks:
- /usr/include
- /usr/src/linux
make[1]: *** [build] Error 1
make[1]: Leaving directory `/usr/src/modules/fglrx-4.2.0-3.7.6'
Module /usr/src/modules/fglrx-4.2.0-3.7.6 failed.
Hit return to Continue
-----------------------------------------------------------
At this point, "include/linux/version.h" reads:
#define UTS_RELEASE "2.6.5"
#define LINUX_VERSION_CODE 132613
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
Where it can be seen that the "UTS_RELEASE" string has been messed
up and is causing the problem. Looking at version.h earlier in the
build (while kernel_image is still being compiled) shows the correct
string in UTS_RELEASE of "2.6.5-pm". It appears that sometime
before or during the first fglrx module is being compiled, version.h
is re-written with the bogus string. So the second and third fglrx
module builds fail.
And as I said, this rewrite of version.h with the bogus version
string doesn't happen with the same build process on a Woody box.
Anyone met and solved this issue before? Anyone building multiple
fglrx module packages with kernel 2.6.5 (or newer) on Sarge?
Obviously, since it works on Woody it must be some combination of
factors that is triggering the behavior.
Thanks!
Dan